//
//  HomeCell.m
//  AppNew
//
//  Created by 华伟 on 2019/4/5.
//  Copyright © 2019 华伟. All rights reserved.
//

#import "HomeCell.h"
#import "HomeModel.h"
@implementation HomeCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setModel:(HomeModel *)model{
//    if (_model != model) {
        _model = model;
        _totalLabel.text = [NSString stringWithFormat:@"24H量 %@",_model.total];
        _nameLabel.text = _model.coinName;
        CGFloat lowFloat = [_model.price floatValue];
        CGFloat highFloat = [_model.price floatValue];
        CGFloat priceFloat = highFloat * _gjfb;
        _detailLabel.text = [NSString stringWithFormat:@"%.4f/%.4fCNY",lowFloat,priceFloat];
        _percentLabel.text = [NSString stringWithFormat:@"%@%%",_model.zd];
        if([_model.zd floatValue] > 0){
            _percentView.backgroundColor = [UIColor redColor];
        }else{
            _percentView.backgroundColor = GreenColor;
        }
//    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
